var channelId;

window.onload = function (){
    channelId = getQuery("id");
};

async function add() {
    let info = await ajaxGet("/main/add",{
        mainName: $("mainName").value,
        mainContent:$("contentTxt").value,
        channelId:channelId
    })

    if(info == "ok"){
        location.href = "/html/main.html?id="+channelId;
    }else {
        alert("添加失败")
    }
}

function back() {
    location.href = "/html/main.html?id="+channelId
}